package com.example.tdj;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class Slip extends Activity {
    Button btn;
    TextView tv;
    int i=0;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.test1);
        btn = findViewById(R.id.btrlt);
        tv=findViewById(R.id.tv);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                switch (i) {
                    case 0:tv.setBackgroundResource(R.drawable.pa);i++;break;
                    case 1:tv.setBackgroundResource(R.drawable.ps);i++;break;
                    case 2:tv.setBackgroundResource(R.drawable.pd);i++;break;
                    case 3:tv.setBackgroundResource(R.drawable.pf);i++;break;
                    case 4:tv.setBackgroundResource(R.drawable.pg);i++;break;
                    case 5:tv.setBackgroundResource(R.drawable.ph);i++;break;
                }
                if(i>=6)
                    i=0;
            }
        });
    }
}
